package com.esri.core.symbol;

import com.esri.core.internal.util.d;
import java.io.StringWriter;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;

/* loaded from: classes.dex */
class a {
    private static final String a = "font";
    private static final String b = "family";
    private static final String c = "size";
    private static final String d = "style";
    private static final String e = "weight";
    private static final String f = "decoration";
    private String g;
    private float h;
    private FontStyle i;
    private FontWeight j;
    private FontDecoration k;

    public a() {
        this.h = 8.0f;
    }

    public a(float f2) {
        this.h = 8.0f;
        this.h = f2;
    }

    public a(JsonNode jsonNode) {
        this.h = 8.0f;
        this.g = d.a(jsonNode, b);
        this.h = d.b(jsonNode, a, this.h);
        this.i = FontStyle.fromString(d.a(jsonNode, d));
        this.j = FontWeight.fromString(d.a(jsonNode, e));
        this.k = FontDecoration.fromString(d.a(jsonNode, f));
    }

    public String a() {
        return this.g;
    }

    public void a(String str) {
        this.g = str;
    }

    public float b() {
        return this.h;
    }

    public void a(float f2) {
        this.h = f2;
    }

    public FontStyle c() {
        return this.i;
    }

    public void a(FontStyle fontStyle) {
        this.i = fontStyle;
    }

    public FontWeight d() {
        return this.j;
    }

    public void a(FontWeight fontWeight) {
        this.j = fontWeight;
    }

    public FontDecoration e() {
        return this.k;
    }

    public void a(FontDecoration fontDecoration) {
        this.k = fontDecoration;
    }

    public String f() throws Exception {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator a2 = d.a(stringWriter);
        if (this.h > 0.0f) {
            a2.writeStartObject();
            a2.writeNumberField(c, (int) this.h);
            String str = this.g;
            if (str != null) {
                a2.writeStringField(b, str);
            }
            FontStyle fontStyle = this.i;
            if (fontStyle != null) {
                a2.writeStringField(d, fontStyle.toString());
            }
            FontWeight fontWeight = this.j;
            if (fontWeight != null) {
                a2.writeStringField(e, fontWeight.toString());
            }
            FontDecoration fontDecoration = this.k;
            if (fontDecoration != null) {
                a2.writeStringField(f, fontDecoration.toString());
            }
            a2.writeEndObject();
        }
        a2.close();
        return stringWriter.toString();
    }

    public a g() throws Exception {
        a aVar = new a();
        aVar.g = this.g;
        aVar.h = this.h;
        aVar.i = this.i;
        aVar.j = this.j;
        aVar.k = this.k;
        return aVar;
    }

    public int hashCode() {
        FontDecoration fontDecoration = this.k;
        int hashCode = ((fontDecoration == null ? 0 : fontDecoration.hashCode()) + 31) * 31;
        String str = this.g;
        int hashCode2 = (((hashCode + (str == null ? 0 : str.hashCode())) * 31) + Float.floatToIntBits(this.h)) * 31;
        FontStyle fontStyle = this.i;
        int hashCode3 = (hashCode2 + (fontStyle == null ? 0 : fontStyle.hashCode())) * 31;
        FontWeight fontWeight = this.j;
        return hashCode3 + (fontWeight != null ? fontWeight.hashCode() : 0);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            a aVar = (a) obj;
            if (this.k != aVar.k) {
                return false;
            }
            String str = this.g;
            if (str == null) {
                if (aVar.g != null) {
                    return false;
                }
            } else if (!str.equals(aVar.g)) {
                return false;
            }
            return Float.floatToIntBits(this.h) == Float.floatToIntBits(aVar.h) && this.i == aVar.i && this.j == aVar.j;
        }
        return false;
    }

    public String toString() {
        return "Font [family=" + this.g + ", size=" + this.h + ", style=" + this.i + "]";
    }
}
